package com.hg.springboottest.controller;

import com.hg.hello.HelloService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;

@RestController
public class UserController {

    //可以正常运行指示idea报错
    @Resource
    HelloService helloService;

    @GetMapping("/user")
    public Map<String, Object> getUser(Integer age) {
        Map<String, Object> map = new HashMap<>();
        map.put("age", 20);
        map.put("name", "kobe");
        helloService.say();
        return map;
    }
}
